
<#if item.type == "textarea">
  <div class="form-group">
	<label for="${item.id}">${item.label}</label>
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if> 
	<textarea name="${item.name}" class="form-control" id="${item.id}" rows="5" placeholder="${item.placeHolder}" ${(item.readOnly)?string('readonly', '')} ${(item.required)?string('required', '')}>${item.value}</textarea>
</div>
<#elseif item.type == "checkbox">
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
	<input name="${item.name}" type="${item.type}" class="form-control" id="${item.id}" ${(item.value == "true")?string('checked', '')} ${(item.readOnly)?string('readonly', '')} ${(item.required)?string('required', '')} >
</div>
<#elseif item.type == "select">
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
	<select id="${item.id}" name="${item.name}" class="form-control" ${(item.required)?string('required', '')}>
	<#list item.options as option>
	  <option value="${option.value}" ${(item.value == option.value)?string('selected', '')}>${option.text}</option>	  
	  </#list>
	</select>
</div>
<#elseif item.type == "radio">
<div class="form-group">
	<label>${item.label}</label>
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
	<#list item.options as option>
	<div class="radio">
	  <label>
	    <input type="radio" name="${item.name}" id="${item.name}_${option.value}" value="${option.value}" ${(item.value == option.value)?string('checked', '')} ${(item.required)?string('required', '')}>
	    ${option.text}
	  </label>
	</div>
	</#list>
</div>
<#elseif item.type == "file">
<div class="form-group">
	<#if item.value != "">
	<#assign x=item.value?split("####")>
	Download file <a href="${documentPath?replace("DOC_ID", x[3])}"">${x[0]}</a><br/>
	</#if>
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
	<input name="${item.name}" type="file" class="form-control" id="${item.id}" onchange="encodeImageFileAsURL(this);" ${(item.required)?string('required', '')} >
</div>
<#elseif item.type == "date">
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
    <input id="${item.id}" name="${item.name}" type="date" class="form-control" value="${item.value}" ${(item.required)?string('required', '')} pattern="${item.pattern}"/>    
</div>
<#elseif item.type == "slider">
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
    <input id="${item.id}" data-slider-id='${item.id}Slider' data-slider-value="${item.value}" name="${item.name}" data-slider-min="${item.min}" data-slider-max="${item.max}" data-slider-step="${item.step}" type="text" class="form-control" value="${item.value}" ${(item.required)?string('required', '')} data-slider-tooltip="hide" data-slider-handle="triangle" style="width: 100%;"/>    
</div>
<#elseif item.type == "documentCollection">
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
    <div id="${item.id}" data-field="documentCollection">
    	<#if item.value?size gt 0>
    	    <#assign documents=item.value>
			<#list documents as file>
			<div class="document"> 
				<span data-field="state"></span>
				<span class="kie-wb-common-forms-docs-upload-content vertical-">
				        <a data-field="document" target="_blank" data-name="${file.name}" data-bytes="${file.content}">${file.name}</a>
				</span>
				<span data-field="actions" class="kie-wb-common-forms-docs-upload-content"><span aria-hidden="true" class="close">×</span></span>
			</div>
			</#list>
		    <div class="kie-wb-common-forms-docs-upload" data-field="dropRegion" >
			<div class="kie-wb-common-forms-docs-upload-dropHere"  data-field="dropHere">
	            <div class="kie-wb-common-forms-docs-upload-dropHere-content">
	                <h3 data-i18n-key="dropFilesHere">Drop files here</h3>
	            </div>
	        </div>
	        </div>
		<#else>
		    <div class="kie-wb-common-forms-docs-upload" data-field="dropRegion" >
	        	<div class="kie-wb-common-forms-docs-upload-empty" data-field="emptyState">
	            	<div class="kie-wb-common-forms-docs-upload-empty-content"  data-field="dragHere" >
		                <h3>
		                    <span data-i18n-key="dragFilesText">Drag files here to upload</span>
		                </h3>
		            </div>
		        </div>
		        <div class="kie-wb-common-forms-docs-upload-dropHere"  data-field="dropHere" style="display: none;">
		            <div class="kie-wb-common-forms-docs-upload-dropHere-content">
		                <h3 data-i18n-key="dropFilesHere">Drop files here</h3>
		            </div>
		        </div>
		    </div>
		</#if>
    </div>
</div>
<#elseif item.type == "multipleSelector">
<div class="form-group">
  <label for="${item.id}">${item.label}</label>
  <#if item.required>
    <strong style="color: red">*</strong>
  </#if>
    <select multiple class="form-control" id="${item.id}" ${(item.readOnly)?string('disabled', '')}>
        <#if item.options?size gt 0>
            <#assign itemList=item.options>
            <#list itemList as option>
                <option value="${option.value}" ${(item.value?seq_contains(option.value))?string('selected','')}>${option.text}</option> 
            </#list>
        </#if>
    </select>
</div>
<#elseif item.type == "multipleInput">
<div class="form-group">
  <label for="${item.id}">${item.label}</label>
  <#if item.required>
    <strong style="color: red">*</strong>
  </#if>
  <input type="text" multiple class="form-control" id="${item.id}" ${(item.readOnly)?string('disabled', '')} data-role="tagsinput" value="${item.value}" />
</div>
<#else>
<div class="form-group">
	<label for="${item.id}">${item.label}</label> 
	<#if item.required>
	<strong style="color: red">*</strong>
	</#if>
	<input name="${item.name}" type="${item.type}" class="form-control" id="${item.id}" placeholder="${item.placeHolder}" value="${item.value}" pattern="${item.pattern}" ${(item.readOnly)?string('readonly', '')} ${(item.required)?string('required', '')}>
</div>
</#if>